/* 可拖动图标样式 */
.draggable-icon {
  position: fixed;
  width: 60px;
  height: 60px;
  z-index: 9999;
  cursor: grab;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.draggable-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.draggable-icon.dragging {
  cursor: grabbing;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* 显示通知时的图标样式 */
.draggable-icon.showing-notification {
  width: 70px;
  height: 70px;
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: notificationPulse 2s ease-in-out infinite;
}

/* 通知脉冲动画 */
@keyframes notificationPulse {
  0%, 100% {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }
}

/* 图标图片容器 */
.icon-image-container {
  position: relative;
  width: 60px;
  height: 60px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 显示通知时的图标图片容器 */
.draggable-icon.showing-notification .icon-image-container {
  width: 70px;
  height: 70px;
}

.icon-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  border: none;
  outline: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 渐变效果 */
.icon-image.fade-in {
  opacity: 1;
}

.icon-image.fade-out {
  opacity: 0;
}

/* 覆盖层图片 */
.icon-image-overlay {
  z-index: 1;
}

/* 跟随窗口样式 */
.following-window {
  position: fixed;
  z-index: 9998;
  pointer-events: auto;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.window-card {
  min-width: 200px;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.window-card .ant-card-head {
  padding: 8px 16px;
  min-height: auto;
  border-bottom: 1px solid #f0f0f0;
}

.window-card .ant-card-body {
  padding: 12px 16px;
}

.window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.window-header .ant-btn {
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 深色主题支持 */
.dark-theme .draggable-icon {
  background: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .draggable-icon:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.dark-theme .draggable-icon.dragging {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.dark-theme .draggable-icon.showing-notification {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dark-theme .draggable-icon.showing-notification {
  animation: notificationPulseDark 2s ease-in-out infinite;
}

@keyframes notificationPulseDark {
  0%, 100% {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  }
}

.dark-theme .window-card {
  background-color: #141414;
  border-color: #303030;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.dark-theme .window-card .ant-card-head {
  background-color: #141414;
  border-bottom-color: #303030;
}

.dark-theme .window-card .ant-card-body {
  background-color: #141414;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .draggable-icon {
    width: 50px;
    height: 50px;
  }
  
  .icon-image {
    width: 50px;
    height: 50px;
  }
  
  .following-window {
    left: 10px !important;
    right: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: 300px;
  }
  
  .window-card {
    min-width: auto;
    max-width: none;
    width: 100%;
  }
}

/* 确保图标在移动端也能正常拖动 */
@media (max-width: 768px) {
  .draggable-icon {
    touch-action: none;
  }
}

/* 防止文本选择 */
.draggable-icon,
.following-window {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 确保图标完全没有边框和轮廓 */
.draggable-icon:focus,
.draggable-icon:active,
.icon-image:focus,
.icon-image:active {
  outline: none;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.draggable-icon:focus-visible,
.icon-image:focus-visible {
  outline: none;
}

/* 窗口关闭动画 */
.following-window.closing {
  animation: slideOut 0.2s ease-in forwards;
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
  }
}

/* 通知窗口样式 */
.notification-window {
  position: fixed;
  z-index: 1000;
  width: 280px;
  transform-origin: center center;
  /* 动画由JavaScript控制，不设置初始状态 */
}

.notification-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  width: 100%;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 出现动画类 */
.notification-appearing {
  opacity: 1 !important;
  transform: scale(1) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 消失动画类 */
.notification-disappearing {
  opacity: 0 !important;
  transform: scale(0) translateX(20px) translateY(10px) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 直接消失动画类 - 使用CSS变量 */
.notification-disappearing-direct {
  opacity: var(--notification-opacity, 0) !important;
  transform: scale(var(--notification-scale, 0)) translateX(var(--notification-translate-x, 20px)) translateY(var(--notification-translate-y, 10px)) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 原生HTML通知卡片样式 */
.notification-card-native {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  width: 280px;
  padding: 16px;
  /* 初始状态由Web Animations API控制 */
}

.notification-header {
  margin-bottom: 12px;
}

.notification-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}


.notification-content {
  margin-bottom: 0;
}

.notification-summary {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}


/* 原生卡片的动画 - 现在由Web Animations API控制 */

/* 默认动画（右侧） */
.notification-window.appearing .ant-card.notification-card {
  opacity: 1 !important;
  transform: scale(1) !important;
  /* 调试：添加边框显示动画状态 */
  border: 2px solid #00ff00 !important;
}

.notification-window.disappearing .ant-card.notification-card {
  opacity: 0 !important;
  transform: scale(0) translateX(20px) translateY(10px) !important;
  /* 调试：添加边框显示动画状态 */
  border: 2px solid #ff0000 !important;
}

/* 左侧动画 */
.notification-window-left.appearing .ant-card.notification-card {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.notification-window-left.disappearing .ant-card.notification-card {
  opacity: 0 !important;
  transform: scale(0) translateX(-20px) translateY(10px) !important;
}

/* 上方动画 */
.notification-window-top.appearing .ant-card.notification-card {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.notification-window-top.disappearing .ant-card.notification-card {
  opacity: 0 !important;
  transform: scale(0) translateY(20px) !important;
}

/* 下方动画 */
.notification-window-bottom.appearing .ant-card.notification-card {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.notification-window-bottom.disappearing .ant-card.notification-card {
  opacity: 0 !important;
  transform: scale(0) translateY(-20px) !important;
}

/* 通知窗口基础动画 - 由JavaScript控制 */
.notification-window {
  /* 动画由JavaScript动态控制 */
}

/* 深色主题通知窗口 */
.dark-theme .notification-window {
  background-color: #141414;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 响应式通知窗口 */
@media (max-width: 768px) {
  .notification-window {
    width: 250px;
    left: 10px !important;
    right: 10px !important;
    max-width: calc(100vw - 20px);
  }
}

